From: Xiaofeng Wang Date: Tue, 31 Mar 2026 07:31:32 +0000 (+0800) Subject: ci: Use Justfile targets in GitHub workflow and add missing v2024_7 feature X-Git-Tag: archive/raspbian/2026.2-1+rpi1~1^2~10^2^2~4^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1dbdaa007180f53f8f784f9c22103c807a50418a;p=ostree.git ci: Use Justfile targets in GitHub workflow and add missing v2024_7 feature - Replace inline cargo fmt/clippy commands in rust.yml with just cargo-fmt-check and just cargo-clippy for consistency with local dev - Make Justfile cargo-clippy use CARGO_PROJECT_FEATURES env var (defaults to v2022_6) so CI and local use share the same config - Add missing v2024_7 feature to Cargo.toml to fix cargo doc failure caused by unexpected cfg condition Co-Authored-By: Claude Opus 4.6 Signed-off-by: Xiaofeng Wang --- diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5f8b8bf0..1f95a94a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,23 +23,16 @@ jobs: - uses: actions/checkout@v2 - name: Cache Dependencies uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72 + - name: Install just + run: dnf install -y just - name: cargo fmt (check) - run: | - cargo fmt -p ostree -- --check -l - for d in tests/inst tests/bootc-integration tests/xtask; do - cargo fmt --manifest-path $d/Cargo.toml -- --check -l - done + run: just cargo-fmt-check - name: Build run: cargo build --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }} - name: Run tests run: cargo test --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }} - name: cargo clippy - run: | - CLIPPY_CONFIG="-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code" - cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} -- $CLIPPY_CONFIG - for d in tests/inst tests/bootc-integration tests/xtask; do - cargo clippy --manifest-path $d/Cargo.toml -- $CLIPPY_CONFIG - done + run: just cargo-clippy - name: cargo doc run: env RUSTDOCFLAGS='-D warnings' cargo doc --lib -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} build-no-features: diff --git a/Cargo.toml b/Cargo.toml index 87206896..13819b4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,6 +101,7 @@ v2022_7 = ["v2022_6", "ffi/v2022_7"] v2023_1 = ["v2022_7", "ffi/v2023_1"] v2023_8 = ["v2023_1", "ffi/v2023_8"] v2023_11 = ["v2023_8", "ffi/v2023_11"] -v2025_1 = ["v2023_11", "ffi/v2025_1"] +v2024_7 = ["v2023_11", "ffi/v2024_7"] +v2025_1 = ["v2024_7", "ffi/v2025_1"] v2025_2 = ["v2025_1", "ffi/v2025_2"] v2025_3 = ["v2025_2", "ffi/v2025_3"] diff --git a/Justfile b/Justfile index 64840429..385d9ec3 100644 --- a/Justfile +++ b/Justfile @@ -135,6 +135,7 @@ clang-format-check: {{sourcefiles}} | xargs clang-format -i --Werror --dry-run clippy_config := "-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code" +cargo_project_features := env('CARGO_PROJECT_FEATURES', 'v2022_6') # Run all Rust lint and format checks (mirrors CI) validate: @@ -148,5 +149,5 @@ cargo-fmt-check: # Run cargo clippy across all crates cargo-clippy: - cargo clippy -p ostree --features=v2022_6 -- {{clippy_config}} + cargo clippy -p ostree --features={{cargo_project_features}} -- {{clippy_config}} for d in tests/inst tests/bootc-integration tests/xtask; do cargo clippy --manifest-path $d/Cargo.toml -- {{clippy_config}}; done diff --git a/rust-bindings/src/repo.rs b/rust-bindings/src/repo.rs index b689daa2..ff826c75 100644 --- a/rust-bindings/src/repo.rs +++ b/rust-bindings/src/repo.rs @@ -68,7 +68,7 @@ unsafe fn from_glib_container_variant_map( /// An open transaction in the repository. /// -/// This will automatically invoke [`ostree::Repo::abort_transaction`] when the value is dropped. +/// This will automatically invoke [`Repo::abort_transaction`] when the value is dropped. pub struct TransactionGuard<'a> { /// Reference to the repository for this transaction. repo: Option<&'a Repo>, @@ -115,7 +115,7 @@ impl Repo { crate::Repo::open_at(dir.as_raw_fd(), path, gio::Cancellable::NONE) } - /// A version of [`create_at`] which resolves the path relative to the provided directory file descriptor, and also returns the opened repo. + /// A version of [`Repo::create_at`] which resolves the path relative to the provided directory file descriptor, and also returns the opened repo. #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn create_at_dir( dir: BorrowedFd<'_>, @@ -128,7 +128,7 @@ impl Repo { Repo::open_at_dir(dir, path) } - /// A wrapper for [`prepare_transaction`] which ensures the transaction will be aborted when the guard goes out of scope. + /// A wrapper for [`Repo::prepare_transaction`] which ensures the transaction will be aborted when the guard goes out of scope. pub fn auto_transaction>( &self, cancellable: Option<&P>, @@ -307,7 +307,7 @@ impl Repo { /// Query metadata for a content object. /// - /// This is similar to [`load_file`], but is more efficient if reading the file content is not needed. + /// This is similar to [`Repo::load_file`], but is more efficient if reading the file content is not needed. pub fn query_file>( &self, checksum: &str,